﻿<!DOCTYPE html>
<html ng-app="demoApp" lang="en">
<head>
    <title id="Description">Data Binding to XML data with values stored in attributes</title>
    <meta name="description" content="This sample demonstrates how we can bind jqwidgets Grid widget to XML Data with attributes by using jqwidgets DataAdapter plugin.">
    <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../../scripts/angular.min.js"></script> <script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../../jqwidgets/jqxdatatable.js"></script>
    <script type="text/javascript" src="../../../scripts/demos.js"></script><script type="text/javascript" src="../../../jqwidgets/jqxangular.js"></script>
    <script type="text/javascript">
        var demoApp = angular.module("demoApp", ["jqwidgets"]);
        demoApp.controller("demoController", function ($scope) {           
 
            // Create AngularJS DataTable
            $scope.gridSettings =
            {
                width: 850,
                source:  new $.jqx.dataAdapter({
                    dataType: 'xml',
                    url: '../../sampledata/xmlattributes.xml',
                    datafields: [
                        { name: 'firstName', map: '[firstName]', type: 'string' },
                        { name: 'lastName', map: '[lastName]', type: 'string' },
                        { name: 'title', map: '[title]', type: 'string' }
                    ],
                    root: 'Table',
                    record: 'Record'
                }),
                columnsResize: true,
                columns: [
                      { text: 'First Name', dataField: 'firstName', width: 250 },
                      { text: 'Last Name', dataField: 'lastName', width: 250 },
                      { text: 'Title', dataField: 'title' }
                ]
            };
        });
    </script>
</head>
 <body ng-controller="demoController">
    <jqx-data-table jqx-settings="gridSettings"></jqx-data-table>
</body>
</html>
